<?php

namespace App\Enums;

use App\Traits\EnumTrait;

class ComplaintScenesEnum
{
    use EnumTrait;

    const USER = ['scene' => 1, 'text' => "用户"];
    const TECHNOLOGY = ['scene' => 2, 'text' => "花样"];
    const COMMODITY = ['scene' => 3, 'text' => "小市集"];
    const MOMENT = ['scene' => 4, 'text' => "万事屋"];

    public static function getEnumByScene($scene)
    {
        foreach (self::getConstants() as $constant) {
            if ($constant['scene'] == $scene) {
                return $constant;
            }
        }
        return null;
    }

    public static function getScene($data)
    {
        return $data['scene'];
    }

    public static function getText($data)
    {
        return $data['text'];
    }

    public static function getSceneToText()
    {
        return array_column(self::getConstants(), 'text', 'scene');
    }
}
